package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.DevParameterRecordDao;
import com.sugon.entity.DevParameterRecordEntity;
import com.sugon.service.DevParameterRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * ${comments}Service实现类
 *
 * @author YuXD
 * @date 2020-05-29 15:40:28
 */
@Service("devParameterRecordService")
public class DevParameterRecordServiceImpl implements DevParameterRecordService {
    @Autowired
    private DevParameterRecordDao devParameterRecordDao;

    /**
     * queryObject
     *
     * @param id 主键
     * @return
     */
    @Override
    public DevParameterRecordEntity queryObject(String id) {
        return devParameterRecordDao.queryObject(id);
    }

    /**
     * queryList
     *
     * @param map 参数
     * @return
     */
    @Override
    public List<DevParameterRecordEntity> queryList(Map<String, Object> map) {
        return devParameterRecordDao.queryList(map);
    }

    /**
     * queryTotal
     *
     * @param map 参数
     * @return
     */
    @Override
    public int queryTotal(Map<String, Object> map) {
        return devParameterRecordDao.queryTotal(map);
    }

    /**
     * save
     *
     * @param devParameterRecord 实体
     * @return
     */
    @Override
    public int save(DevParameterRecordEntity devParameterRecord) {
        devParameterRecord.setId(RandomUtil.randomString(32));
        return devParameterRecordDao.save(devParameterRecord);
    }

    /**
     * update
     *
     * @param devParameterRecord 实体
     * @return
     */
    @Override
    public int update(DevParameterRecordEntity devParameterRecord) {
        return devParameterRecordDao.update(devParameterRecord);
    }

    /**
     * delete
     *
     * @param id
     * @return
     */
    @Override
    public int delete(String id) {
        return devParameterRecordDao.delete(id);
    }

    /**
     * deleteBatch
     *
     * @param ids
     * @return
     */
    @Override
    public int deleteBatch(String[] ids) {
        return devParameterRecordDao.deleteBatch(ids);
    }
}
